import ScrollBarLayout from '@/components/ScrollBarLayout';
import Cls from 'classnames';
import { useContext } from 'react';
import { ConractControllerContext } from '../common';
import { contractInfoEffect } from '../mconfig';
import { TypographyTitle } from '@/components/Typography/TypographyTitle';
import { UpdatePaymentView } from '../mview/UpdatePaymentView';

export const DetailInfoCenterViewPaymentOA: React.FC = () => {
  /** 获取上下文 */
  const { styleFixCls, curRes, contractDetailInfo, contractForm } = useContext(ConractControllerContext);

  /** 初始化数据 */
  contractInfoEffect(contractDetailInfo, contractForm);

  return (
    <>
      <div className="commonTabsBodyDom">
        <div className={Cls('tabsBodyInfoDom', `${styleFixCls}updateFormBox`)}>
          <ScrollBarLayout style={{ padding: '5px 100px' }}>
            <TypographyTitle children={'履约关键节点'} style={{ textAlign: 'center', borderLeft: 'none' }} level={3} />
            <UpdatePaymentView formName={contractForm} selectPaymentType={contractDetailInfo?.payStyle} />
          </ScrollBarLayout>
        </div>
      </div>
    </>
  );
};
